package com.inossem.allotin.api;

import com.inossem.allotin.constant.UrlConstant;
import com.inossem.wms.co.transport.TransportLocationSearchCo;
import com.inossem.wms.co.transport.TransportSearchCo;
import com.inossem.wms.co.transport.TransportSubmitCo;
import com.inossem.wms.co.wf.WfReceiptCo;
import com.inossem.wms.model.file.LogFile;
import com.inossem.wms.vo.BaseBean;
import com.inossem.wms.vo.BaseObject;
import com.inossem.wms.vo.auth.DicStockLocationAndWhTreeVo;
import com.inossem.wms.vo.auth.DicWhTreeVo;
import com.inossem.wms.vo.transport.TransportHeadVo;
import com.inossem.wms.vo.transport.TransportItemVo;
import com.inossem.wms.vo.transport.TransportResultVo;
import com.inossem.wms.vo.wf.WfProcTaskListVo;

import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * @author haoli
 */
public interface TransportInputApiService {
    /**
     * 查询单据列表
     */
    @POST(UrlConstant.URL_TRANSPORT_INPUT_GET_TRANSPORT_LIST)
    Call<BaseObject<TransportHeadVo>> getTransportList(@Body TransportSearchCo description);

    /**
     * 删除订单
     */
    @GET(UrlConstant.URL_TRANSPORT_INPUT_DELETE + "/{stock_transport_code}")
    Call<BaseObject<TransportResultVo>> delete(@Path("stock_transport_code") String stockTransportCode);

    /**
     * 查询单据详细信息
     */
    @GET(UrlConstant.URL_TRANSPORT_INPUT_GET_TRANSPORT_INFO + "/{stock_transport_code}")
    Call<BaseObject<TransportItemVo>> getTransportInfo(@Path("stock_transport_code") String stockTransportCode);

    /**
     * 保存或提交
     */
    @POST(UrlConstant.URL_TRANSPORT_INPUT_SAVE_OR_UPDATE)
    Call<BaseObject<String>> saveOrUpdate(@Body TransportSubmitCo description);

    //获取库存地点列表
    @POST(UrlConstant.URL_ALLOT_APPLY_LOCATION_DATA)
    Call<BaseObject<DicStockLocationAndWhTreeVo>> getLocationList(@Body TransportLocationSearchCo co);

    // 流程实时状态信息查询，获取审批流以及当前进度状态
    @POST(UrlConstant.URL_WF_RECEIPT_GET_NODE_BY_ID)
    Call<BaseObject<WfProcTaskListVo>> getNodeById(@Body WfReceiptCo co);

    //上传
    @Multipart
    @POST(UrlConstant.URL_FILE_UPLOAD)
    Call<BaseObject<LogFile>> upload(@Part MultipartBody.Part pic);

    //获取储存类型 储存单元 目标仓位
    @GET(UrlConstant.URL_CHANGE_STORAGE_GET_RECEIVE_POSITION)
    Call<BaseObject<DicWhTreeVo>> getBinTree(@Query("whCode") String whCode, @Query("cusWhSys") String cusWhSys);
}